package com.xiaoyu.base.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.xiaoyu.base.entity.HotAreaEntity;

import java.util.List;

import static androidx.room.OnConflictStrategy.REPLACE;

@Dao
public interface HotAreaDao {

    @Insert(onConflict = REPLACE)
    void upsert(HotAreaEntity entity);

    @Insert(onConflict = REPLACE)
    void upsertAll(List<HotAreaEntity> entities);

    @Query("SELECT * FROM hot_area ORDER BY ROWID ASC")
    List<HotAreaEntity> getHotAreaEntities();
}
